package 抽象数据类型.LRU缓存;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @description:
 * @author: ywk
 * @date: 2020-12-06
 */
public class FIFOCache1 {
    final int cacheSize = 5;
    LinkedHashMap<Integer, String> lru = new LinkedHashMap<Integer, String>() {
        @Override
        protected boolean removeEldestEntry(Map.Entry<Integer, String> eldest) {
            return size() > cacheSize;
        }
    };
}
